/*
 * Android Runner is a multiplayer GPS game fully written by Xurxo Mendez Perez
 * 
 * Copyright (C) 2009 Xurxo Mendez Perez
 *   
 * This file is part of Android Runner.
 * 
 * Android Runner is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Android Runner is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Android Runner.  If not, see <http://www.gnu.org/licenses/>.
 */

package es.sonxurxo.androidrunner.model.service.game.to;

import java.util.HashSet;
import java.util.Set;

import es.sonxurxo.androidrunner.model.persistence.item.entity.Item;

/**
 * 
 * @author "Xurxo Mendez Perez"
 *
 */
public class GenericGameResponseTO {

	private boolean hasFinished = false;

	private Set<InGamePlayerInfoTO> inGamePlayerInfoTOs = 
		new HashSet<InGamePlayerInfoTO>();
	private Set<MessageTO> myMessages = 
		new HashSet<MessageTO>();
	private Set<Item> visibleItems =
		new HashSet<Item>();

	public GenericGameResponseTO() {}
	
	public GenericGameResponseTO(Set<InGamePlayerInfoTO> playersLocations, 
			Set<MessageTO> myMessages, Set<Item> visibleItems) {
		super();
		this.inGamePlayerInfoTOs = playersLocations;
		this.myMessages = myMessages;
		this.visibleItems = visibleItems;
	}
	
	public boolean isHasFinished() {
		return hasFinished;
	}

	public void setHasFinished(boolean hasFinished) {
		this.hasFinished = hasFinished;
	}

	public Set<MessageTO> getMyMessages() {
		return myMessages;
	}

	public void setMyMessages(Set<MessageTO> myMessages) {
		this.myMessages = myMessages;
	}

	public Set<InGamePlayerInfoTO> getInGamePlayerInfoTOs() {
		return inGamePlayerInfoTOs;
	}

	public void setInGamePlayerInfoTOs(Set<InGamePlayerInfoTO> inGamePlayerInfoTOs) {
		this.inGamePlayerInfoTOs = inGamePlayerInfoTOs;
	}

	public Set<Item> getVisibleItems() {
		return visibleItems;
	}

	public void setVisibleItems(Set<Item> visibleItems) {
		this.visibleItems = visibleItems;
	}
	
	public String toString() {
		String s = new String();
		String fgs = new String("");
		s = s.concat("\nSERVER RESPONSE\n" + 
				"- hasFinished : \n" + 
				fgs);
		s = s.concat("MESSAGES : \n");
//		while (this.myMessages.iterator().hasNext())
//			s = s.concat(this.myMessages.iterator().next().toString());
//		while (this.playersLocations.iterator().hasNext())
//			s = s.concat(this.playersLocations.iterator().next().toString());
//		while (this.visibleItems.iterator().hasNext())
//			s = s.concat(this.visibleItems.iterator().next().toString());
		return s;
		
	}
}
